﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ET.Entity;
using ET.DbUtility;
using System.Data.SqlClient;

namespace ET.DataAccess
{
    public class DaServiceInfo
    {
        public List<EtServiceInfo> GetAllUnDeleted()
        {
            string sql = "SELECT * FROM EtServiceInfo WHERE IsDeleted = 0 ORDER BY ServiceName";

            return EtSqlEntityHelper<EtServiceInfo>.GetEntitySet(sql);
        }

        public int Insert(EtServiceInfo serviceInfo)
        {
            string sql = string.Format("INSERT INTO EtServiceInfo(ServiceName) VALUES(@ServiceName)");

            SqlParameter param = new SqlParameter("@ServiceName",serviceInfo.ServiceName);

            return EtSqlHelper.ExecuteNonQuery(sql,param);
        }
    }
}
